<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="../node_modules/@vue/runtime-dom/dist/runtime-dom-global.js"></script>
    <script>
      const { createApp, h, reactive, onMounted } = VueRuntimeDOM

      let App = {
        setup(props, context) {
          const state = reactive({ name: 1000 })
          const fn = () => {
            state.name += 100
          }

          onMounted(() => {
            console.log("onMounted")
          })
          onMounted(() => {
            console.log("onMounted")
          })
          onMounted(() => {
            console.log("onMounted")
          })
          onMounted(() => {
            console.log("onMounted")
          })

          return () => {
            return h("h1", { onClick: fn }, state.name)
          }
        }
      }

      const app = createApp(App, { name: "test", age: 18 })
      app.mount("#app")
    </script>
  </body>
</html>
